<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	<script src="../JQ/jquery-3.5.1.min.js"></script>
	<script>
		$(document).ready(function(){
			$("#subbtn").bind("click",function(event){
				var username=$("#username").val();
				if(username==""){
					alert("用户名不能为空！");
					$("#username").focus();
					event.preventDefault();
				}
			})
		})
	</script>
	</head>
	<body>
		<form action="05表单提交页面.html" method="post">
			用户名:<input type="text" id="username" />
			<input type="submit"  id="subbtn" value="注册" />
		</form>
	</body>
</html>
